<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set the idle callback function</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="zmqdevice.run.html">« ZMQDevice::run</a></li>
      <li style="float: right;"><a href="zmqdevice.setidletimeout.html">ZMQDevice::setIdleTimeout »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.zmqdevice.html">ZMQDevice</a></li>
    <li>Set the idle callback function</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="zmqdevice.setidlecallback" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZMQDevice::setIdleCallback</h1>
  <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">ZMQDevice::setIdleCallback</span> &mdash; <span class="dc-title">Set the idle callback function</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-zmqdevice.setidlecallback-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>ZMQDevice::setIdleCallback</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$cb_func</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$timeout</code></span>, <span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$user_data</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="class.zmqdevice.html" class="type ZMQDevice">ZMQDevice</a></span></div>

  <p class="para rdfs-comment">
   Sets the idle callback function. If idle timeout is defined the idle callback function
   shall be called if the internal poll loop times out without events. If the callback function
   returns false or a value that evaluates to false the device is stopped.

   The callback function signature is callback (mixed $user_data).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-zmqdevice.setidlecallback-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">cb_func</code></dt>

    <dd>

     <p class="para">
      Callback function to invoke when the device is idle. Returning false
      or a value that evaluates to false from this function will cause the 
      device to stop.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">timeout</code></dt>

    <dd>

     <p class="para">
      How often to invoke the idle callback in milliseconds. The idle callback is invoked
      periodically when there is no activity on the device.
      The timeout value guarantees that there is at least this amount of milliseconds between
      invocations of the callback function.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">user_data</code></dt>

    <dd>

     <p class="para">
      Additional data to pass to the callback function.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-zmqdevice.setidlecallback-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   On success this method returns the current object.
  </p>
 </div>



</div></div></div></body></html>